//
//  VideoModel.swift
//  TestConcurreces
//
//  Created by rolodestar on 2025/6/16.
//

@available(macOS 14,iOS 17, *)
typealias VideoModel = VideoModelV3
import SwiftData
import Foundation
@available(macOS 14,iOS 17, *)
@Model
class VideoModelV3: NetVideoProtol{
    var resumeData: Data?
    
    var id: UUID
    
    var remoteUrl: URL
    var localUrl: URL?
    var downloadProgress: Double
    init(id: UUID, remoteUrl: URL, localUrl: URL? = nil) {
        self.id = id
        self.remoteUrl = remoteUrl
        self.localUrl = localUrl
        self.downloadProgress = 0.0
        self.resumeData = nil
    }
    
    static var debugVideo: VideoModel{
//        let videomodel = VideoModel(id: <#T##PersistentIdentifier#>, remoteUrl: <#T##URL#>)
        return VideoModel(id: UUID(), remoteUrl: URL(string: "https://txmov2.a.kwimgs.com/upic/2024/01/31/15/BMjAyNDAxMzExNTAyMjNfOTQ0MjI3OThfMTIzNjAxOTMwNzQ4XzFfMw==_b_B13ad5de6e59107566026b3701a63a1d2.mp4?clientCacheKey=3xaz973garbxxue_b.mp4&tt=b&di=78e498d6&bp=13414")!)
    }
}
